<?php if(isset($isInsert) && $isInsert){
?>
<script>
	ajax('listContent','<?php echo $this->params['controller']?>/lists');
	closeBox('addContent','mainContent');
</script>
<?php
}
else{
?>
<fieldset>
    <legend><?php _resource('add '.$this->params['controller']);?></legend>
<center><div id="message">&nbsp;</div></center>
<?php if($this->Session->read('message')){
	echo '<script>showMessage("addContent","'.$this->Session->read('message').'");</script>';
	$this->Session->delete('message');	
	}?>
<?php if($this->Session->read('error')){
	echo '<script>showMessage("addContent","'.$this->Session->read('error').'",1);</script>';
	$this->Session->delete('error');
}?>
    <form id="adminForm" name="adminForm" method="post" action="<?php echo $this->params['controller'] ?>/add" onsubmit="onFormSubmit();return false;">
    
	<table border="0" class="form" style="width:100%">        
		
		<tr>          
       		<td class="label" align="right" width="100px"><?php _resource('name') ?>
       		
       		</td>
       		<td align="left"><?php echo $this->Form->input($uses[0].'.name',array('class'=>'input','label'=>'','size'=>60,'maxlength'=>255));?></td>           
        </tr>      
		<tr>          
       		<td class="label" align="right" width="100px"><?php _resource('url') ?>
       		
       		</td>
       		<td align="left"><?php echo $this->Form->input($uses[0].'.url',array('class'=>'input','label'=>'','size'=>60,'maxlength'=>255));?></td>           
        </tr>  
        
        <tr>          
       		<td class="label" align="right" width="100px"><?php _resource('username') ?>
       		
       		</td>
       		<td align="left"><?php echo $this->Form->input($uses[0].'.username',array('class'=>'input','label'=>'','size'=>60,'maxlength'=>255));?></td>           
        </tr> 
        <tr>          
       		<td class="label" align="right" width="100px"><?php _resource('password') ?>
       		
       		</td>
       		<td align="left"><?php echo $this->Form->input($uses[0].'.password',array('class'=>'input','label'=>'','size'=>60,'maxlength'=>255));?></td>           
        </tr> 
       
 	
        
            
	</table>
	<center>
    <div style="width:130px">
          <div class="button"><a onclick="onFormSubmit()" href="javascript:;" title="<?php echo _resource('save') ?>"  > <span class="icon-32-save"> </span></a> </div>         
          <div class="button"><a onclick="resetForm('adminForm')" href="javascript:;" title="<?php echo _resource('reset') ?>"  > <span class="icon-32-back"> </span></a> </div>
          <div class="button"><a onclick="deactivateEditors();closeBox('addContent','mainContent')" href="javascript:;" title="<?php echo _resource('close') ?>"  > <span class="icon-32-cancel"> </span></a> </div>
    </div>
    </center>
      </form>
</fieldset>


<script>
	
	function onFormSubmit(){
		
		submitForm('adminForm','addContent');
	}	
	

scrollTopTo('addContent');
</script>
<?php }?>